import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter)

let constRouter = [
  {
    path: '/',
    redirect: '/index'
  }, {
    path: '/index',
    component: () => import('./views/common/IndexView.vue')
  }, {
    path: '/explore',
    component: () => import('./views/common/ExploreView.vue')
  }, {
    path: '/nearby',
    component: () => import('./views/common/NearbyView.vue')
  }, {
    path: '/search',
    component: () => import('./views/common/SearchView.vue')
  }, {
    path: '/login',
    component: () => import('./views/common/LoginView.vue')
  }, {
    path: '/test',
    component: () => import('./views/common/TestView.vue')
  }, {
    path: '/my',
    component: () => import('./views/common/MyView.vue')
  }, {
    path: '/login-success',
    component: () => import('./views/info/LoginSuccess.vue')
  }, {
    path: '*',
    component: () => import('./views/info/404.vue')
  }
]

let router = new VueRouter({
  mode: 'history',
  routes: constRouter
})

export default router
